using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Dormitory : IAccessible<T_Dormitory, Dormitory>, ILogicEntity<T_Dormitory, Dormitory>
    {
        public int ID { get; set; }

        public string DormitoryName { get; set; }

        public int SalesUnitID { get; set; }

        #region Fileds
        public string SalesUnitName { get; set; }
        #endregion

        protected override void Covariant(T_Dormitory model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.DormitoryName = model.DormitoryName;
                    this.SalesUnitID = model.SalesUnitID;
            }
}
        protected override T_Dormitory Inverter(Dormitory model)
        {
            if (model != null)
            {
                return new T_Dormitory()
                {
                    ID = model.ID,
                    DormitoryName = model.DormitoryName,
                    SalesUnitID = model.SalesUnitID,
                };
            }
            return null;
        }
        public Dormitory Set(T_Dormitory dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
